package org.csmzxy.class2333;

import java.util.Scanner;

public class ShuiXianHuaSuanFa {
        public static void main(String[] args){
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入一个三位数");
            int num = scanner.nextInt();
            if (num >= 100 && num <= 999){
                int a = num / 100;
                int b = (num / 10) % 10;
                int c = num % 10;
                if (num == a * a * a + b * b * b + c * c * c){
                    System.out.println(num + "是水仙花数");
                }else {
                    System.out.println("不是水仙花数");
                }
            }else {
                System.out.println("输入的不是三位数,请重新输入");
                scanner.close();
            }
        }
}
